import request from '@/utils/request'

// 查询审批记录列表
export function listAccraditationrecord(query) {
  return request({
    url: '/accraditationrecord/accraditationrecord/list',
    method: 'get',
    params: query
  })
}

// 查询审批记录列表(我的申请)
export function listAccraditationrecord1(query) {
  return request({
    url: '/accraditationrecord/accraditationrecord/list1',
    method: 'get',
    params: query
  })
}


// 根据步骤和外键id查询唯一审批记录
export function getUniqueRecord(query) {
  return request({
    url: '/accraditationrecord/accraditationrecord/unique',
    method: 'get',
    params: query
  })
}
// 查询审批记录详细
export function getAccraditationrecord(id) {
  return request({
    url: '/accraditationrecord/accraditationrecord/' + id,
    method: 'get'
  })
}

// 新增审批记录
export function addAccraditationrecord(data) {
  return request({
    url: '/accraditationrecord/accraditationrecord',
    method: 'post',
    data: data
  })
}

// 修改审批记录
export function updateAccraditationrecord(data) {
  return request({
    url: '/accraditationrecord/accraditationrecord',
    method: 'put',
    data: data
  })
}

// 删除审批记录
export function delAccraditationrecord(id) {
  return request({
    url: '/accraditationrecord/accraditationrecord/' + id,
    method: 'delete'
  })
}

// 新增：根据drop_content_id查询审批记录
export function getAccraditationrecordByDropContentId(dropContentId) {
  return request({
    url: `/accraditationrecord/accraditationrecord/dropContentId/${dropContentId}`,
    method: 'get'
  })
}


// 新增：根据checkContentId删除审批记录（对应后端接口）
export function delAccraditationrecordByCheckContentId(checkContentId) {
  return request({
    url: `/accraditationrecord/accraditationrecord/checkContentId/${checkContentId}`,
    method: 'delete'
  })
}
